﻿using Android.Media;
using Android.Runtime;
using NAudio.Wave;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Intrinsics.X86;
using System.Text;
using System.Threading.Tasks;

namespace InteractiveMusicPlayerMobile.Platforms.Android.音频播放
{
    public class 播放流
    {
        private global::Android.Media.Stream music;
        private int 采样率;
        private ChannelOut 声道类型;
        private global::Android.Media.Encoding 编码格式;
        private int 最小缓冲区;
        private AudioTrackMode stream;
        public AudioTrack 流 { get; set; }
        public int 流编号 { get; set; } = -1;
        public string 流别名 { get; set; } = "未定义流的别名";
        public WaveFormat WaveFormat { get; set; }
        public 播放流(global::Android.Media.Stream music, int 采样率, ChannelOut 声道类型, global::Android.Media.Encoding 编码格式, int 最小缓冲区, AudioTrackMode stream)
        {
            this.music = music;
            this.采样率 = 采样率;
            this.声道类型 = 声道类型;
            this.编码格式 = 编码格式;
            this.最小缓冲区 = 最小缓冲区;
            this.stream = stream;
            流 = new AudioTrack(music, 采样率, 声道类型, 编码格式, 最小缓冲区, stream);
        }
        public void 设置音频格式(WaveFormat 格式)
        {
            if (WaveFormat != 格式)
            {
                WaveFormat = 格式;
            }
        }


    }
}
